package com.pan.controller;

import com.pan.entity.Result;
import com.pan.service.OperationCouponService;
import com.pan.service.impl.OperationCouponServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Controller
public class SeckillCouponController {

    @Resource
    private OperationCouponService operationCouponService;

    @PostMapping("/coupon/setSeckill/{couponId}")
    @ResponseBody
    public Result setSeckill(@CookieValue("adminTicket") String adminTicket,
                             @PathVariable("couponId") Long couponId){
        Result result = operationCouponService.setSeckillCoupon(adminTicket,couponId);
        return result;
    }
}
